﻿// ******************************************************************
// * Copyright(c)  Steven Lu
// * Description   : Entity_REP_CHECK_REPORT_PIC
// * CreateDate    : 2012-1-9 17:25:41
// * Creater       : CodeSmith
// * LastChangeDate: 2012-1-9 17:25:41
// * LastChanger   : 2012-1-9 17:25:41
// * Version Info  : 1.0 For ESOL
// ******************************************************************

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using ESOL.Common.Entity;
using Suzsoft.Smart.Data;
using System.Data;
using ESOL.Common;

namespace ESOL.Business.Rep
{
    /// <summary>
    /// RepCheckReportPic
    /// </summary>
    public partial class RepCheckReportPicBs
    {
        #region GetByID
        /// <summary>
        /// Get Entity
        /// </summary>
        /// <param name="objRepCheckReportPicEntity">Entity</param>
        /// <returns>Entity</returns>
        public static RepCheckReportPicEntity GetRepCheckReportPic(RepCheckReportPicEntity objRepCheckReportPicEntity)
        {
            return DataAccess.SelectSingle<RepCheckReportPicEntity>(objRepCheckReportPicEntity);
        }
        #endregion


        #region Insert
        /// <summary>
        /// Insert Data
        /// </summary>
        /// <param name="objRepCheckReportPicEntity">Entity</param>
        /// <returns>true Insert Succeed; false Insert Fail</returns>
        public static bool InsertRepCheckReportPic(RepCheckReportPicEntity objRepCheckReportPicEntity)
        {
            return DataAccess.Insert(objRepCheckReportPicEntity);
        }

        public static bool InsertRepCheckReportPic(List<RepCheckReportPicEntity> objRepCheckReportPicEntityList)
        {
            return DataAccess.Insert(objRepCheckReportPicEntityList);
        }
        #endregion


        #region Update
        /// <summary>
        /// Update Data
        /// </summary>
        /// <param name="objRepCheckReportPicEntity">Entity</param>
        /// <returns>true Update Succeed; false Update Fail</returns>
        public static bool UpdateRepCheckReportPic(RepCheckReportPicEntity objRepCheckReportPicEntity)
        {
            return DataAccess.Update(objRepCheckReportPicEntity);
        }

        public static bool UpdateRepCheckReportPic(List<RepCheckReportPicEntity> objRepCheckReportPicEntityList)
        {
            return DataAccess.Update<RepCheckReportPicEntity>(objRepCheckReportPicEntityList);
        }
        #endregion


        #region Delete
        /// <summary>
        /// Delete Data
        /// </summary>
        /// <param name="objRepCheckReportPicEntity">Entity</param>
        /// <returns>true Delete Succeed; false Delete Fail</returns>
        public static bool DeleteRepCheckReportPic(RepCheckReportPicEntity objRepCheckReportPicEntity)
        {
            return DataAccess.Delete(objRepCheckReportPicEntity);
        }

        public static bool DeleteRepCheckReportPic(List<RepCheckReportPicEntity> objRepCheckReportPicEntityList)
        {
            return DataAccess.Delete<RepCheckReportPicEntity>(objRepCheckReportPicEntityList);
        }
        #endregion


        #region GetAll
        /// <summary>
        /// Get All Data
        /// </summary>
        /// <returns>Back All Data<returns>
        public static DataSet GetRepCheckReportPicAll()
        {
            return DataAccess.SelectAllDataSet<RepCheckReportPicEntity>();
        }
        /// <summary>
        /// Get All Data List
        /// </summary>
        /// <returns>Back All Data List<returns>
        public static List<RepCheckReportPicEntity> GetRepCheckReportPicAllList()
        {
            return DataAccess.SelectAll<RepCheckReportPicEntity>();
        }
        #endregion

        #region Functions
        public static DataTable GetDtCheckReportPicByCheckReportID(string CheckReportID)
        {
            if (string.IsNullOrEmpty(CheckReportID))
                return null;
            string Sql = @"SELECT * FROM REP_CHECK_REPORT_PIC RCRP
                WHERE RCRP.CHECK_REPORT_ID='"+CheckReportID+"'";
            DataSet ds = DataAccess.SelectDataSet(Sql);
            if (ds != null && ds.Tables[0] != null)
            {
                return ds.Tables[0];
            }
            else return null;
        }
        #endregion
    }


}

